import React, { Component } from 'react';

const Hoc3 = (WrappedComponent) => {
  return class extends WrappedComponent {
    constructor(props) {
      super(props);
      this.state = {
        name: 'Hoc3',
      };
    }

    componentWillMount() {
      console.log('hoc3 will be mounted');
    }

    render() {
      return (
        <div>
          {super.render()}
        </div>
      )
    }

    componentDidMount() {
      console.log('hoc3 did be mounted');
    }

    componentWillUnmount() {
      console.log('hoc3 will be unmounted');
    }
  };
};

export default Hoc3;
